Repository navigation
Conversation
Add a generic (*API).Filter method to construct a filtered copy of an API surface, keeping Rust/prost-specific reachability rules in internal/librarian/rust/generate_prost_hybrid.go. Part of googleapis#7837
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the API model filtering logic used in Rust Prost hybrid generation by extracting it from generate_prost_hybrid.go into a reusable Filter method on the API struct, accompanied by new unit tests. The code review feedback highlights several important issues: the Codec field is missing from the filtered API copy, message-level resource definitions are omitted during lookup map population, and a map comparison in the tests will cause a compilation error. Additionally, some test assertions need to be updated to conform to the repository's style guide for cmp.Diff error formatting.
coryan
marked this pull request as ready for review
November 20, 2026 19:28
coryan
marked this pull request as draft
November 20, 2026 19:29
coryan
marked this pull request as ready for review
November 20, 2026 19:58
Contributor
Author
|
@amanda-tarafa this is towards the read-only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a generic (*API).Filter method to construct a filtered copy of an API surface.
Later I will use this to make
api.APIread-only and still select what to filter in the Rust codec.Part of #7837